package cloud.xlh.exceptionhandle.service.impl;


import cloud.xlh.exceptionhandle.service.BusinessExceptionAssert;
import cloud.xlh.exceptionhandle.service.IResponseEnum;
import lombok.AllArgsConstructor;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2022/12/8 14:06
 * @ Description: 业务异常枚举
 */
@AllArgsConstructor
public enum BusinessExceptionEnum implements IResponseEnum, BusinessExceptionAssert {

    /**
     * NullPointerException 空指针异常
     */
    NULLPOINTEREXCEPTION(0000, "空指针异常"),
    /**
     * DateBaseOperateException
     */
    DATEBASEOPERATEEXCEPTION(0001, "数据库操作异常"),
    /**
     * DuplicateRequest
     */
    DUPLICATEREQUEST(0002, "重复请求"),
    /**
     * TokenNotExist
     */
    TOKENNOTEXIST(0003, "Token不存在"),

    /**
     * IpLocked
     */
    IPLOCKED(0004, "ip被锁定"),

    /**
     * TokenInvalid
     */
    TOKENINVALID(0005, "令牌失效"),

    /**
     * UserinfoNotExist
     */
    USERINFONOTEXIST(0006, "用户信息不存在"),

    /**
     * FileLoadException
     **/
    FILE_LOAD_EXCEPTION(0007 , "文件加载异常"),

    /**
     * DecryptFail
     **/
    DECRYPT_FAIL(0010 , "解密失败");

    /**
     * 返回码
     */
    private int code;
    /**
     * 返回消息
     */
    private String message;

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }

}
